#:kivy 1.1.0

Root:
    bom_text_input: bom_text_input
    number_text_input: number_text_input
    BoxLayout:
        orientation: 'vertical'
        pos_hint: {'x': 0, 'top': 1}
        size_hint: 1, 0.3
        BoxLayout:
            width: 900
            height: 30
            Label:
                size_hint: 0.3,1
                text: 'Bom文件'
                font_name:'font/ARIALUNI'
            TextInput:
                id: bom_text_input
                text: ''
                font_name:'font/ARIALUNI'
            Button:
                size_hint: 0.2,1
                text: '加载'
                on_release: root.show_bom_load()
                font_name:'font/ARIALUNI'
        BoxLayout:
            width: 900
            height: 30
            Label:
                size_hint: 0.3,1
                text: '物料编号文件'
                font_name:'font/ARIALUNI'
            TextInput:
                id: number_text_input
                text: ''
                font_name:'font/ARIALUNI'
            Button:
                size_hint: 0.2,1
                text: '加载'
                on_release: root.show_number_load()
                font_name:'font/ARIALUNI'
        BoxLayout:
            width: 900
            height: 30
            Button:
                size_hint: 0.2,1
                text: '生成新文件'
                on_release: root.create_newfile()
                font_name:'font/ARIALUNI'

<LoadDialog>:
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"
        FileChooserListView:
            path: './'
            id: filechooser
            font_name:'font/ARIALUNI'

        BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: "Cancel"
                on_release: root.cancel()

            Button:
                text: "Load"
                on_release: root.load(filechooser.path, filechooser.selection)

<SaveDialog>:
    text_input: text_input
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"
        FileChooserListView:
            id: filechooser
            on_selection: text_input.text = self.selection and self.selection[0] or ''
            font_name:'font/ARIALUNI'

        TextInput:
            id: text_input
            size_hint_y: None
            height: 30
            multiline: False

        BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: "Cancel"
                on_release: root.cancel()

            Button:
                text: "Save"
                on_release: root.save(filechooser.path, text_input.text)